package com.kensure.shike.order.model;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import co.kensure.frame.BaseInfo;

import com.kensure.shike.baobei.model.SKBaobei;
import com.kensure.shike.baobei.model.SKBaobeiYansePic;
import com.kensure.shike.sys.model.SKDict;
import com.kensure.shike.sys.service.SKDictService;

/**
 * 订单记录对象类
 * 
 * @author fankd created on 2019-6-12
 * @since
 */
public class SKOrder extends BaseInfo {

	private static final long serialVersionUID = 3545276994084105527L;

	/** 主键 */
	private Long id;
	/** 商家id */
	private Long sjid;
	/** 标题 */
	private String title;
	/** 砍价id */
	private Long kjid;

	/** 宝贝id */
	private Long bbid;

	/** 颜色 */
	private String yanse;

	/** 尺码 */
	private String chima;

	/** 宝贝单价 */
	private Double salePrice;
	/** 代金券数额 */
	private Double djqse;
	/** 抵用金 */
	private Double dbyue;

	/** 数量 */
	private Integer bbnum;

	/** 订单总价 */
	private Double total;

	/** 用户id */
	private Long userid;

	/** 1是申请，-1是撤销，9是完成，2是拒绝 */
	private Integer status;

	/** 0是未发生退换，1是换货，2是退货 */
	private Integer typeid;
	/** 是否预约单，0否，1是 */
	private Integer yuyue;

	/** 预约寿命 */
	private String yuyueRemark;

	/** 退还金额 */
	private Double tuihuan;

	/** 换货时间 */
	private Date hhTime;

	/** 备注 */
	private String remark;

	/** 优惠金额 */
	private Double youhui;

	/** 需要分润的钱,总价-优惠金额-抵用金 */
	private Double fenrun;

	/** 账务id */
	private Long finpayid;
	
	/** 使用说明 */
	private String content;

	/** 宝贝 */
	private SKBaobei baobei;
	/** 规格对象 */
	private SKBaobeiYansePic yansepic;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getBbid() {
		return bbid;
	}

	public void setBbid(Long bbid) {
		this.bbid = bbid;
	}

	public String getYanse() {
		return yanse;
	}

	public void setYanse(String yanse) {
		this.yanse = yanse;
	}

	public String getChima() {
		return chima;
	}

	public void setChima(String chima) {
		this.chima = chima;
	}

	public Double getSalePrice() {
		return salePrice;
	}

	public void setSalePrice(Double salePrice) {
		this.salePrice = salePrice;
	}

	public Integer getBbnum() {
		return bbnum;
	}

	public void setBbnum(Integer bbnum) {
		this.bbnum = bbnum;
	}

	public Double getTotal() {
		return total;
	}

	public void setTotal(Double total) {
		this.total = total;
	}

	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getStatusStr() {
		SKDict dict = SKDictService.getDictCache(3, this.status + "");
		String temp = "";
		if (dict != null) {
			temp = dict.getName();
		}
		return temp;
	}

	public Date getHhTime() {
		return hhTime;
	}

	public void setHhTime(Date hhTime) {
		this.hhTime = hhTime;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public SKBaobei getBaobei() {
		return baobei;
	}

	public void setBaobei(SKBaobei baobei) {
		this.baobei = baobei;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Double getYouhui() {
		return youhui;
	}

	public void setYouhui(Double youhui) {
		this.youhui = youhui;
	}

	public Long getFinpayid() {
		return finpayid;
	}

	public void setFinpayid(Long finpayid) {
		this.finpayid = finpayid;
	}

	public Long getKjid() {
		return kjid;
	}

	public void setKjid(Long kjid) {
		this.kjid = kjid;
	}

	public Double getFenrun() {
		return fenrun;
	}

	public void setFenrun(Double fenrun) {
		this.fenrun = fenrun;
	}

	public Integer getTypeid() {
		return typeid;
	}

	public void setTypeid(Integer typeid) {
		this.typeid = typeid;
	}

	public Double getTuihuan() {
		return tuihuan;
	}

	public void setTuihuan(Double tuihuan) {
		this.tuihuan = tuihuan;
	}

	public Integer getYuyue() {
		return yuyue;
	}

	public void setYuyue(Integer yuyue) {
		this.yuyue = yuyue;
	}

	public String getYuyueRemark() {
		return yuyueRemark;
	}

	public void setYuyueRemark(String yuyueRemark) {
		this.yuyueRemark = yuyueRemark;
	}

	public String getBackName() {
		String temp = "";
		if (typeid == null || status == null) {
			return temp;
		}
		if (typeid == 1) {
			temp = "换货";
		} else if (typeid == 2) {
			temp = "退货";
		}
		if (StringUtils.isNotBlank(temp)) {
			if (status == -1) {
				temp = "撤销" + temp;
			} else if (status == 1) {
				temp = "申请" + temp;
			} else if (status == 2) {
				temp = "拒绝" + temp;
			} else if (status == 9) {
				temp = "完成" + temp;
			}
		}
		return temp;
	}

	public Long getSjid() {
		return sjid;
	}

	public void setSjid(Long sjid) {
		this.sjid = sjid;
	}

	public Double getDjqse() {
		return djqse;
	}

	public void setDjqse(Double djqse) {
		this.djqse = djqse;
	}

	public Double getDbyue() {
		return dbyue;
	}

	public void setDbyue(Double dbyue) {
		this.dbyue = dbyue;
	}

	public SKBaobeiYansePic getYansepic() {
		return yansepic;
	}

	public void setYansepic(SKBaobeiYansePic yansepic) {
		this.yansepic = yansepic;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

}
